3c6b11aad3e83729c3e79cc6b36523276974c0cc,OpdsOutput/src/main/java/com/gmail/dpierron/calibre/opds/Catalog.java,Catalog,syncFiles,#CachedFile#CachedFile#,260

Before Change


                if (logger.isTraceEnabled()) logger.trace("File " + src.getName() + ": Skip copy as CRC's match");
                copyCrcMisses++;
                copyflag = false;
                if (syncLog) {
                  syncLogFile.printf("NOT COPIED (CRC same): %s\n", src.getName());
                  syncLogFile.println();
                }
              }
            }

After Change


        dst.clearCachedInformation();
      } else {

        if (dst.isChanged() == false) {
          copyflag = false;
          copyUnchanged++;
        } else {
          if (syncFilesDetail && logger.isTraceEnabled()) logger.trace("File " + src.getName() + ": .. exists on target");
          // Target present, so check lengths
          if (src.length() != dst.length()) {
            if (logger.isTraceEnabled()) logger.trace("File " + src.getName() + ": Copy as size changed");
            copyLengthHits++;
            copyflag = true;
            CatalogManager.syncLogPrintln("COPIED (length changed): %s\n", src.getName());
          } else {
            if (syncFilesDetail && logger.isTraceEnabled()) logger.trace("File " + src.getName() + ": .. size same on source and target");

            // Size unchanged, so check dates
            // TODO  There could be some issues if the date/time on the target
            //       is different to the machine running calibre2opds.  It might
            //       be worth adding some code to calculate the difference and
            //       use the results in the date comparisons. However for the
            //       time being we are assuming this is not an issue.
            if (src.lastModified() <= dst.lastModified()) {
              // Target newer than source
              if (logger.isTraceEnabled()) logger.trace("File " + src.getName() + ": Skip Copy as source is not newer");
              copyDateMisses++;
              copyflag = false;
              CatalogManager.syncLogPrintln("NOT COPIED (Source not newer): %s\n", dst.getName());
            } else {
              if (syncFilesDetail && logger.isTraceEnabled()) logger.trace("File " + src.getName() + ": .. source is newer");
              if (CatalogManager.isSourceFileSameAsTargetFile(src,dst)) {
                if (logger.isTraceEnabled()) logger.trace("File " + src.getName() + ": Skip copy as CRC's match");
                copyCrcMisses++;
                copyflag = false;
                CatalogManager.syncLogPrintln("NOT COPIED (CRC same): %s\n", src.getName());
              } else {
                if (logger.isTraceEnabled()) logger.trace("File " + src.getName() + ": Copy as CRC's different");
                copyCrcHits++;
                copyflag = true;
                CatalogManager.syncLogPrintln("COPIED (CRC changed): %s\n", src.getName());
              }
            }
          }